<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<% 
String t_i=request.getParameter("task_id");
String t_name=request.getParameter("task_name");
String p_i=request.getParameter("project_id");
String summary=request.getParameter("summary");
String t_status=request.getParameter("status");
String t_type=request.getParameter("type");
String t_s_date=request.getParameter("s_date");
String t_e_date=request.getParameter("e_date");
int p_id=Integer.parseInt(p_i);
int t_id=Integer.parseInt(t_i);
%>
<%
String query="insert into task values("+t_id+","+"'"+t_name+"'"+","+p_id+","+"'"+summary+"'"+","+"'"+t_status+"'"+","+"'"+t_type+"'"+","+"'"+t_s_date+"'"+","+"'"+t_e_date+"'"+")";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
statement.executeUpdate(query);

db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>            



